package com.leadingsoft.pwxk.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.leadingsoft.common.converter.AbstractConverter;
import com.leadingsoft.pwxk.dto.MaterialDto;
import com.leadingsoft.pwxk.model.Material;

/**
 * @author: lipan 2018年5月15日
 * @description: ()
 * 
 */

@Component
public class MaterialConverter extends AbstractConverter<Material, MaterialDto> {

	
	@Autowired
	private PoisonousConverter poisonousConverter;
	
	@Override
	protected MaterialDto toDtoActual(Material model) {

		MaterialDto dto = new MaterialDto();
		dto.setId(model.getId());
		dto.setDataid(model.getDataid());
		dto.setAverage(model.getAverage());
		dto.setDevicename(model.getDevicename());
		dto.setFuelname(model.getFuelname());
		dto.setIssecretname(model.getIssecretname());
		dto.setOneamount(model.getOneamount());
		dto.setOneyear(model.getOneyear());
		dto.setOthercontent(model.getOthercontent());
		dto.setPoison(model.getPoison());
		dto.setProdunit(model.getProdunit());
		dto.setPurity(model.getPurity());
		dto.setSpercent(model.getSpercent());
		dto.setTechnicsname(model.getTechnicsname());
		dto.setThreeamount(model.getThreeamount());
		dto.setThreeyear(model.getThreeyear());
		dto.setTwoamount(model.getTwoamount());
		dto.setUnitsname(model.getUnitsname());
		dto.setTwoyear(model.getTwoyear());
		dto.setUtilization(model.getUtilization());
		dto.setYearamount(model.getYearamount());
		dto.setPoisonouslist(poisonousConverter.toDto(model.getPoisonousList()));

		return dto;
	}

	@Override
	public void copyProperties(Material model, MaterialDto dto) {

	}

}
